# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=libplacebo
pkgver=3.120.3
pkgrel=3
pkgdesc='Reusable library for GPU-accelerated video/image rendering primitives'
url='https://github.com/haasn/libplacebo'
arch=('x86_64')
license=('LGPL2.1')
depends=('vulkan-icd-loader' 'libvulkan.so' 'glslang' 'lcms2' 'liblcms2.so' 'shaderc' 'libshaderc_shared.so'
         'libepoxy' 'libglvnd' 'glibc' 'gcc-libs')
makedepends=('meson' 'ninja' 'vulkan-headers' 'python' 'python-mako')
provides=('libplacebo.so')
source=(https://code.videolan.org/videolan/libplacebo/-/archive/v${pkgver}/libplacebo-v${pkgver}.tar.gz)
sha512sums=('6a2d3c6c053edc3a912a46f9c16d226d83c6f8880714f0b20a8b9417889616e4c1d4d41b8935b898cc580dc3b480ce974bb3921162165f0774ea91be1dfff520')
b2sums=('6192570dba8de6e0bb98ccf3f0e4f13c01a27c5f97873ff0e5e3212d9b7cdebd98cce3d5ee5364ca8a585ec2a16d0bafc5a863ed35f6f225d86a4410b92edfd3')

build() {
  cd ${pkgbase}-v${pkgver}
  CXXFLAGS+=" -I/usr/include/glslang"
  arch-meson build \
    -D tests=true \
    -D vulkan=enabled \
    -D glslang=enabled \
    -D shaderc=enabled \
    -D lcms=enabled
  ninja -C build
}

check() {
  cd ${pkgbase}-v${pkgver}
  ninja -C build test
}

package() {
  cd ${pkgbase}-v${pkgver}
  DESTDIR="${pkgdir}" ninja -C build install
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
